(function() { var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};templates['base-layout'] = template(function (Handlebars,depth0,helpers,partials,data) {
  this.compilerInfo = [4,'>= 1.0.0'];
helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
  


  return "<div id=\"header\" class=\"container\"></div>\n<div class=\"clearfix\"></div>\n<div id=\"body\" class=\"container rounded\">\n    <div class=\"row\">\n        <div class=\"main-content\">\n            <div class=\"page-content\">\n            </div>\n        </div>\n    </div>\n</div>\n<div id=\"footer\" class=\"container\"></div>";
  } ); })();(function() { var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};templates['body'] = template(function (Handlebars,depth0,helpers,partials,data) {
  this.compilerInfo = [4,'>= 1.0.0'];
helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
  


  return "<div class=\"row\">\n    </br>\n    <div class=\"page-header  position-relative\">\n        <h3>Recetas ABC(Filtro general)</h3>\n    </div>\n</div>\n<!--Div tipo Fila, es similar a la fila de una tabla-->\n<div class=\"row\">\n    <div>\n        <a href=\"Busqueda.html\">A</a>&nbsp; \n        <a href=\"Busqueda.html\">B</a>&nbsp; \n        <a href=\"Busqueda.html\">C</a>&nbsp; \n        <a href=\"Busqueda.html\">D</a>&nbsp; \n        <a href=\"Busqueda.html\">E</a>&nbsp; \n        <a href=\"Busqueda.html\">F</a>&nbsp; \n        <a href=\"Busqueda.html\">G</a>&nbsp;\n        <a href=\"Busqueda.html\">H</a>&nbsp; \n        <a href=\"Busqueda.html\">I</a>&nbsp; \n        <a href=\"Busqueda.html\">J</a>&nbsp; \n        <a href=\"Busqueda.html\">K</a>&nbsp; \n        <a href=\"Busqueda.html\">L</a>&nbsp; \n        <a href=\"Busqueda.html\">M</a>&nbsp; \n        <a href=\"Busqueda.html\">N</a>&nbsp;\n        <a href=\"Busqueda.html\">O</a>&nbsp; \n        <a href=\"Busqueda.html\">P</a>&nbsp; \n        <a href=\"Busqueda.html\">Q</a>&nbsp; \n        <a href=\"Busqueda.html\">R</a>&nbsp; \n        <a href=\"Busqueda.html\">S</a>&nbsp; \n        <a href=\"Busqueda.html\">T</a>&nbsp; \n        <a href=\"Busqueda.html\">U</a>&nbsp;\n        <a href=\"Busqueda.html\">V</a>&nbsp; \n        <a href=\"Busqueda.html\">W</a>&nbsp; \n        <a href=\"Busqueda.html\">X</a>&nbsp; \n        <a href=\"Busqueda.html\">Y</a>&nbsp; \n        <a href=\"Busqueda.html\">Z</a>&nbsp;\n    </div>\n    <br />\n</div>\n\n<div class=\"row\">\n    <div class=\"panel pull-left\" style=\"width: 70%;\">\n        <!-- Carousel\n            ================================================== -->\n        <div id=\"myCarousel\" class=\"carousel slide\" data-ride=\"carousel\">\n            <!-- Indicators -->\n            <ol class=\"carousel-indicators\">\n                <li data-target=\"#myCarousel\" data-slide-to=\"0\" class=\"active\"></li>\n                <li data-target=\"#myCarousel\" data-slide-to=\"1\"></li>\n                <li data-target=\"#myCarousel\" data-slide-to=\"2\"></li>\n                <\n            </ol>\n            <div class=\"carousel-inner \">\n                <div class=\"item active center-block \" style=\"width: 400px; max-height: 100%; height: auto;\n                    position: relative;\">\n                    <a href=\"#\">\n                        <img src=\"/dew/resources/image/ComidaChina1.jpg\" alt=\"Arroz chaufa\" class=\"img-thumbnail img-responsive\" />\n                    </a>\n                    <!--<img data-src=\"/dew/resources/image/ComidaChina1.jpg\" alt=\"First slide\"/>-->\n                    <div class=\"container\">\n                        <div class=\"carousel-caption\">\n                        </div>\n                    </div>\n                </div>\n                <div class=\"item center-block\" style=\"width: 400px; max-height: 100%; height: auto;\">\n                    <a href=\"#\">\n                        <img src=\"/dew/resources/image/ComidaChina2.jpg\" alt=\"Pollo Enrollado\" class=\"img-thumbnail img-responsive\" />\n                    </a>\n                    <!--<img data-src=\"holder.js/900x500/auto/#666:#6a6a6a/text:Second slide\" alt=\"Second slide\">-->\n                    <div class=\"container\">\n                        <div class=\"carousel-caption\">\n                            <!--<a class=\"btn btn-lg btn-primary\" href=\"#\" role=\"button\">Learn more</a></p>-->\n                        </div>\n                    </div>\n                </div>\n                <div class=\"item center-block\" style=\"width: 400px; max-height: 100%; height: auto;\">\n                    <a href=\"#\">\n                        <img src=\"/dew/resources/image/comidachina3.jpg\" alt=\"Pollo con verduras\" class=\"img-thumbnail img-responsive \" />\n                    </a>\n                    <!--<img data-src=\"holder.js/900x500/auto/#555:#5a5a5a/text:Third slide\" alt=\"Third slide\">-->\n                    <div class=\"container\">\n                        <div class=\"carousel-caption\">\n                        </div>\n                    </div>\n                </div>\n                <div class=\"item center-block\" style=\"width: 400px; max-height: 100%; height: auto;\">\n                    <a href=\"#\">\n                        <img src=\"/dew/resources/image/comidadelaSelva1.jpg\" alt=\"Tacacho con Cecina\" class=\"img-thumbnail img-responsive \" />\n                    </a>\n                    <div class=\"container\">\n                        <div class=\"carousel-caption\">\n                        </div>\n                    </div>\n                </div>\n                <div class=\"item center-block\" style=\"width: 400px; max-height: 100%; height: auto;\">\n                    <a href=\"#\">\n                        <img src=\"/dew/resources/image/comidadelaSelva2.jpg\" alt=\"Zarapatera\" class=\"img-thumbnail img-responsive \" />\n                    </a>\n                    <div class=\"container\">\n                        <div class=\"carousel-caption\">\n                        </div>\n                    </div>\n                </div>\n                <div class=\"item center-block\" style=\"width: 400px; max-height: 100%; height: auto;\">\n                    <a href=\"#\">\n                        <img src=\"/dew/resources/image/comidadelaSelva3.jpg\" alt=\"Patarashca\" class=\"img-thumbnail img-responsive \" />\n                    </a>\n                    <div class=\"container\">\n                        <div class=\"carousel-caption\">\n                        </div>\n                    </div>\n                </div>\n                <div class=\"item center-block\" style=\"width: 400px; max-height: 100%; height: auto;\">\n                    <a href=\"#\">\n                        <img src=\"/dew/resources/image/comidadelaSelva4.jpg\" alt=\"Chaufa Selvatico\" class=\"img-thumbnail img-responsive \" />\n                    </a>\n                    <div class=\"container\">\n                        <div class=\"carousel-caption\">\n                        </div>\n                    </div>\n                </div>\n                <div class=\"item center-block\" style=\"width: 400px; max-height: 100%; height: auto;\">\n                    <a href=\"#\">\n                        <img src=\"/dew/resources/image/comidacriolla1.jpg\" alt=\"Lomo Saltado\" class=\"img-thumbnail img-responsive \" />\n                    </a>\n                    <div class=\"container\">\n                        <div class=\"carousel-caption\">\n                        </div>\n                    </div>\n                </div>\n                <div class=\"item center-block\" style=\"width: 400px; max-height: 100%; height: auto;\">\n                    <a href=\"#\">\n                        <img src=\"/dew/resources/image/comidacriolla2.jpg\" alt=\"Aj&iacute; de Gallina\" class=\"img-thumbnail img-responsive \" />\n                    </a>\n                    <div class=\"container\">\n                        <div class=\"carousel-caption\">\n                        </div>\n                    </div>\n                </div>\n                <div class=\"item center-block\" style=\"width: 400px; max-height: 100%; height: auto;\">\n                    <a href=\"#\">\n                        <img src=\"/dew/resources/image/comidacriolla3.jpg\" alt=\"Parihuela\" class=\"img-thumbnail img-responsive \" />\n                    </a>\n                    <div class=\"container\">\n                        <div class=\"carousel-caption\">\n                        </div>\n                    </div>\n                </div>\n                <div class=\"item center-block\" style=\"width: 400px; max-height: 100%; height: auto;\">\n                    <a href=\"#\">\n                        <img src=\"/dew/resources/image/comidacriolla4.jpg\" alt=\"Seco de Fejoles\" class=\"img-thumbnail img-responsive \" />\n                    </a>\n                    <div class=\"container\">\n                        <div class=\"carousel-caption\">\n                        </div>\n                    </div>\n                </div>\n                <div class=\"item center-block\" style=\"width: 400px; max-height: 100%; height: auto;\">\n                    <a href=\"#\">\n                        <img src=\"/dew/resources/image/comidacriolla5.jpg\" alt=\"Cebiche de Pescado\" class=\"img-thumbnail img-responsive \" />\n                    </a>\n                    <div class=\"container\">\n                        <div class=\"carousel-caption\">\n                        </div>\n                    </div>\n                </div>\n            </div>\n            <a class=\"left carousel-control\" href=\"#myCarousel\" data-slide=\"prev\"><span class=\"glyphicon glyphicon-chevron-left\">\n            </span></a><a class=\"right carousel-control\" href=\"#myCarousel\" data-slide=\"next\"><span\n                class=\"glyphicon glyphicon-chevron-right\"></span></a>\n        </div>\n        <!-- /.carousel -->\n    </div>\n    <div class=\"panel panel-danger pull-right\" style=\"width: 30%\">\n        <div class=\"panel-heading\">\n            <h3 class=\"panel-title\">\n                Receta del d&iacute;a</h3>\n        </div>\n        <div class=\"panel-body\">\n            Preparar el arroz con kion y poca sal. Aparte, batir los huevos ligeramente, sazonarlos\n            y fre&iacute;rlos en una sart&eacute;n con poco aceite...\n            <br />\n            <a href=\"#\">Leer m&aacute;s</a>\n        </div>\n    </div>\n</div>\n<div class=\"row\">\n    <div class=\"panel panel-danger pull-left\" style=\"width: 70%\">\n        <div class=\"panel-heading\">\n            <h3 class=\"panel-title\">\n                Las m&aacute;s buscadas</h3>\n        </div>\n        <div class=\"panel-body\">\n            <div class=\"list-group\">\n                <a href=\"#\" class=\"list-group-item \">\n                    <h4 class=\"list-group-item-heading\">\n                    </h4>\n                    <p class=\"list-group-item-text\">\n                        Receta de \"Aj&iacute; de gallina\"... <span class=\"glyphicon glyphicon-star\"></span><span\n                            class=\"glyphicon glyphicon-star\"></span><span class=\"glyphicon glyphicon-star\">\n                        </span><span class=\"glyphicon glyphicon-star-empty\"></span><span class=\"glyphicon glyphicon-star-empty\">\n                        </span>\n                    </p>\n                </a><a href=\"#\" class=\"list-group-item\">\n                    <h4 class=\"list-group-item-heading\">\n                    </h4>\n                    <p class=\"list-group-item-text\">\n                        Receta de \"arroz con pollo\"... <span class=\"glyphicon glyphicon-star\"></span><span\n                            class=\"glyphicon glyphicon-star\"></span><span class=\"glyphicon glyphicon-star\">\n                        </span><span class=\"glyphicon glyphicon-star-empty\"></span><span class=\"glyphicon glyphicon-star-empty\">\n                        </span>\n                    </p>\n                </a><a href=\"#\" class=\"list-group-item\">\n                    <h4 class=\"list-group-item-heading\">\n                    </h4>\n                    <p class=\"list-group-item-text\">\n                        Receta de \"Pollo enrollado\"... <span class=\"glyphicon glyphicon-star\"></span><span\n                            class=\"glyphicon glyphicon-star\"></span><span class=\"glyphicon glyphicon-star\">\n                        </span><span class=\"glyphicon glyphicon-star-empty\"></span><span class=\"glyphicon glyphicon-star-empty\">\n                        </span>\n                    </p>\n                </a>\n            </div>\n            <br />\n            <a href=\"#\">Leer m&aacute;s</a>\n        </div>\n    </div>\n    <div class=\"panel pull-right\">\n        <div class=\"panel-heading\">\n            <h3 class=\"panel-title\">\n                Publicidad</h3>\n        </div>\n        <div class=\"panel-body\">\n            <!--aqui va algunas ofertas-->\n        </div>\n    </div>\n</div>\n<div class=\"row\">\n    <div class=\"panel panel-success\">\n        <div class=\"panel-heading\">\n            <h3 class=\"panel-title\">\n                Registrate en &iquest;Qu&eacute; cocinar&eacute;?</h3>\n        </div>\n        <div class=\"panel-body\">\n            <div class=\"pull-left\">\n                <div class=\"container-fluid\">\n                    <p>\n                        <span class=\"glyphicon glyphicon-check\"></span>&nbsp;Crea tu perfil\n                    </p>\n                    <p>\n                        <span class=\"glyphicon glyphicon-floppy-disk\"></span>&nbsp;Guarda tu receta\n                    </p>\n                    <p>\n                        <span class=\"glyphicon glyphicon-share-alt\"></span>&nbsp;Comparte tus recetas\n                    </p>\n                    <a href=\"register.html\" class=\"list-inline\">>>empieza aqu&iacute;... </a>\n                </div>\n            </div>\n            <div class=\"pull-left\">\n                colocar imagen\n            </div>\n        </div>\n    </div>\n</div>";
  } ); })();(function() { var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};templates['details-layout'] = template(function (Handlebars,depth0,helpers,partials,data) {
  this.compilerInfo = [4,'>= 1.0.0'];
helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
  


  return "<div id=\"header\" class=\"container\"></div>\n<div class=\"clearfix\"></div>\n<div id=\"body\" class=\"container rounded\">\n    <div class=\"row\">\n        <div class=\"details-main-content\">\n            <div class=\"page-content details-content\">\n            </div>\n            <div class=\"comments\">\n            </div>\n        </div>\n    </div>\n</div>";
  } ); })();(function() { var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};templates['finder-layout'] = template(function (Handlebars,depth0,helpers,partials,data) {
  this.compilerInfo = [4,'>= 1.0.0'];
helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
  


  return "<div id=\"header\" class=\"container\"></div>\n<div class=\"clearfix\"></div>\n<div id=\"body\" class=\"container rounded\">\n    <div class=\"row\">\n        <div class=\"sidebar\">\n        </div>\n        <div class=\"main-content\">\n            <div class=\"page-content\">\n            </div>\n        </div>\n    </div>\n</div>";
  } ); })();(function() { var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};templates['footer'] = template(function (Handlebars,depth0,helpers,partials,data) {
  this.compilerInfo = [4,'>= 1.0.0'];
helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
  


  return "<div style=\"text-align: center;margin: 10px 0px 30px 0px;\">Univerisdad Peruana de Ciencias aplicadas - EPE - DEW - 2013-1-M0</div>\n";
  } ); })();(function() { var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};templates['header'] = template(function (Handlebars,depth0,helpers,partials,data) {
  this.compilerInfo = [4,'>= 1.0.0'];
helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
  


  return "<div class=\"header\">\n    <div class=\"row\">\n        <img src=\"/dew/resources/image/logo.png\" class=\"pull-left\" alt=\"Logo\" />\n        <div class=\"pull-right\" style=\"width: 40%;\">\n            <ul class=\"nav\" >\n                <li class=\"nav-starter\">&nbsp;</li>\n                <li>\n                    <a id=\"btnLogin\" href=\"#login\">Ingresar</a>\n                    <div class=\"nav-separator\"></div>\n                </li>\n                <li>\n                    <a id=\"btnResgistrate\" href=\"/dew/register\">Registrate</a>\n                    <div class=\"nav-separator\"></div>\n                </li>\n                <li>\n                    <a href=\"perfilusuarioform.html\">Perfil de Usuario</a>\n                    <div class=\"nav-separator\"></div>\n                </li>\n                <li class=\"nav-finisher\">&nbsp;</li>\n            </ul>\n            <div class=\"input-group input-group-sm\">\n                <input type=\"text\" class=\"form-control\" placeholder=\"Encuentra aqu&iacute; mas de 1000 recetas\" />\n                <span class=\"input-group-addon\"><a href=\"Busqueda.html\" class=\"glyphicon glyphicon-search\"></a> </span>\n            </div>\n        </div>\n    </div>\n\n    <!--Aqui va el menu de forma horizontal-->\n    <div class=\"row\">\n        <nav class=\"navbar navbar-default\" role=\"navigation\">\n            <div class=\"navbar-header\">\n                <div class=\"collapse navbar-collapse\" id=\"bs-example-navbar-collapse-1\">\n                    <ul class=\"nav navbar-nav\">\n                        <li><a href=\"/dew/home\">Inicio</a></li>\n                        <li><a href=\"#\">Tipo de comida</a></li>\n                        <li><a id=\"btnTipoCocina\" href=\"#finder\">Tipo de cocina</a></li>\n                        <li><a href=\"#\">Bebidas</a></li>\n                    </ul>\n                </div>\n            </div>\n        </nav>\n    </div>\n</div>";
  } ); })();(function() { var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};templates['item'] = template(function (Handlebars,depth0,helpers,partials,data) {
  this.compilerInfo = [4,'>= 1.0.0'];
helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
  var stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;

function program1(depth0,data) {
  
  var buffer = "", stack1;
  buffer += "\n\n    <div class=\"container\">\n<hr size=\"\" />\n<hr size=\"\" />\n<div class=\"col-md-5\">\n        <div class=\"pull-left\">\n            <img src=\"";
  if (stack1 = helpers.url) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.url; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "\" alt=\"";
  if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "\"/>\n        </div>\n</div>\n\n<div class=\"col-md-4\">\n        <div class=\"panel panel-default\" >\n\n  <div class=\"panel-heading\">\n<h3 class=\"name\">";
  if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "</h3>\n   \n            <p>";
  if (stack1 = helpers.producer) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.producer; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "</p>\n            <p>";
  if (stack1 = helpers.stars) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.stars; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + " estrellas  </p>\n  </div>\n </div>\n  </div>\n  </div>\n<hr size=\"10\" />\n\n\n<div class=\"col-md-8\">\n \n<div class=\"panel panel-default\">\n  <div class=\"panel-heading\">\n    <h3 class=\"panel-title\">Ingredientes :</h3>\n  </div>\n  <div class=\"panel-body\">\n    <p>";
  if (stack1 = helpers.ing1) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.ing1; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "</p>\n    <p>";
  if (stack1 = helpers.ing2) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.ing2; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "</p>\n    <p>";
  if (stack1 = helpers.ing3) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.ing3; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "</p>\n    <p>";
  if (stack1 = helpers.ing4) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.ing4; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "</p>\n    <p>";
  if (stack1 = helpers.ing5) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.ing5; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "</p>\n    <p>";
  if (stack1 = helpers.ing6) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.ing6; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "</p>\n    <p>";
  if (stack1 = helpers.ing7) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.ing7; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "</p>\n    <p>";
  if (stack1 = helpers.ing8) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.ing8; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "</p>\n    <p>";
  if (stack1 = helpers.ing9) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.ing9; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "</p>\n    <p>";
  if (stack1 = helpers.ing10) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.ing10; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "</p>\n    <p>";
  if (stack1 = helpers.ing11) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.ing11; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "</p>\n    <p>";
  if (stack1 = helpers.ing12) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.ing12; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "</p>\n\n  </div> \n</div>\n</div>\n<div class=\"col-md-8\">\n \n<div class=\"panel panel-default\">\n  <div class=\"panel-heading\">\n    <h3 class=\"panel-title\">Preparaci&oacute;n :</h3>\n  </div>\n  <div class=\"panel-body\">\n                <p>";
  if (stack1 = helpers.p1) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.p1; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "</p>\n                <p>";
  if (stack1 = helpers.p2) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.p2; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "</p>\n                <p>";
  if (stack1 = helpers.p3) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.p3; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "</p>\n                <p>";
  if (stack1 = helpers.p4) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.p4; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "</p>\n                <p>";
  if (stack1 = helpers.p5) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.p5; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "</p>\n\n  </div> \n</div>\n</div>\n </div>\n          \n        </div>\n    </div>\n";
  return buffer;
  }

  stack1 = helpers['with'].call(depth0, depth0.item, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
  if(stack1 || stack1 === 0) { return stack1; }
  else { return ''; }
  } ); })();(function() { var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};templates['list'] = template(function (Handlebars,depth0,helpers,partials,data) {
  this.compilerInfo = [4,'>= 1.0.0'];
helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
  var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;

function program1(depth0,data) {
  
  var buffer = "", stack1;
  buffer += "\n        <div class=\"col-md-3\">\n            <div class=\"thumbnail item\">\n                <a href=\"#details/";
  if (stack1 = helpers.id) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "\">\n                    <img alt=\"";
  if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "\" src=\"";
  if (stack1 = helpers.url) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.url; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "\">\n                </a>\n                <h5><a href=\"#details/";
  if (stack1 = helpers.id) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "\">";
  if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "</a></h5>\n                <p>";
  if (stack1 = helpers.producer) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.producer; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "</p>\n                <div class=\"info-days\">\n                    <div class=\"left\">\n                        ";
  if (stack1 = helpers.stars) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.stars; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + " estrellas / \n                    </div>\n                    <div class=\"clear\"></div>\n                </div>\n            </div>\n        </div>\n    ";
  return buffer;
  }

  buffer += " <div class=\"pull-right\" style=\"width: 85%;\">\n\n    ";
  stack1 = helpers.each.call(depth0, depth0.list, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
  if(stack1 || stack1 === 0) { buffer += stack1; }
  buffer += "\n</div>";
  return buffer;
  } ); })();(function() { var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};templates['login'] = template(function (Handlebars,depth0,helpers,partials,data) {
  this.compilerInfo = [4,'>= 1.0.0'];
helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
  


  return "\n<div class=\"row\">\n    </br>\n    <form class=\"form-signin\" role=\"form\">\n        <h2 class=\"form-signin-heading\">\n            Ingresa y sigue compartiendo</h2>\n        <input type=\"email\" class=\"form-control\" placeholder=\"Email address\" required autofocus>\n        <input type=\"password\" class=\"form-control\" placeholder=\"Password\" required>\n        <label class=\"checkbox\">\n            <input type=\"checkbox\" value=\"remember-me\">\n            Recordarme\n        </label>\n        <button id=\"btnIniciar Sesion\" class=\"btn btn-lg btn-primary btn-block\" type=\"submit\">\n            Iniciar Sesi&oacute;n</button>\n    </form>\n</div>  ";
  } ); })();(function() { var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};templates['popup-window'] = template(function (Handlebars,depth0,helpers,partials,data) {
  this.compilerInfo = [4,'>= 1.0.0'];
helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
  var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;

function program1(depth0,data) {
  
  var buffer = "", stack1;
  buffer += "\n                <a href=\"javascript:void(0);\" id=\"";
  if (stack1 = helpers.id) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "\" class=\"popup-window-footer-btn btn btn-small ";
  stack1 = helpers['if'].call(depth0, depth0.primary, {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data});
  if(stack1 || stack1 === 0) { buffer += stack1; }
  buffer += " ";
  stack1 = helpers.unless.call(depth0, depth0.primary, {hash:{},inverse:self.noop,fn:self.program(4, program4, data),data:data});
  if(stack1 || stack1 === 0) { buffer += stack1; }
  buffer += " ";
  stack1 = helpers['if'].call(depth0, depth0.hidden, {hash:{},inverse:self.noop,fn:self.program(6, program6, data),data:data});
  if(stack1 || stack1 === 0) { buffer += stack1; }
  buffer += " \">";
  if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "</a>\n            ";
  return buffer;
  }
function program2(depth0,data) {
  
  
  return " btn-primary ";
  }

function program4(depth0,data) {
  
  
  return "btn-danger";
  }

function program6(depth0,data) {
  
  
  return "hidden-button";
  }

  buffer += "<div class=\"popup-window modal ";
  if (stack1 = helpers.ctClass) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.ctClass; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "\">\n  <div class=\"modal-dialog\">\n    <div class=\"modal-content\">\n        <div class=\"modal-header\">\n            <h4>";
  if (stack1 = helpers.title) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.title; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "</h4>\n        </div>\n        <div class=\"modal-body\">\n        </div>\n        <div class=\"popup-window-footer modal-footer\">\n            <div class=\"main-buttons\">\n            ";
  stack1 = helpers.each.call(depth0, depth0.buttons, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
  if(stack1 || stack1 === 0) { buffer += stack1; }
  buffer += "\n            </div>\n        </div>\n     </div>\n   </div>\n</div>";
  return buffer;
  } ); })();(function() { var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};templates['sidebar'] = template(function (Handlebars,depth0,helpers,partials,data) {
  this.compilerInfo = [4,'>= 1.0.0'];
helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
  var buffer = "", stack1, self=this, functionType="function", escapeExpression=this.escapeExpression;

function program1(depth0,data) {
  
  var buffer = "", stack1;
  buffer += "\n        <li ";
  stack1 = helpers['if'].call(depth0, depth0.active, {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data});
  if(stack1 || stack1 === 0) { buffer += stack1; }
  buffer += ">\n            <a href=\"#\" class=\"category_link\" data-id=\"";
  if (stack1 = helpers.id) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "\">\n                <i class=\"icon-chevron-right\"></i> ";
  if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  buffer += escapeExpression(stack1)
    + "\n            </a>\n        </li>\n    ";
  return buffer;
  }
function program2(depth0,data) {
  
  
  return "class=\"active\"";
  }

  buffer += "<ul class=\"nav nav-pills nav-stacked\">\n    ";
  stack1 = helpers.each.call(depth0, depth0.categories, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
  if(stack1 || stack1 === 0) { buffer += stack1; }
  buffer += "\n</ul>";
  return buffer;
  } ); })();DEW.CategoriesCollection = Backbone.Collection.extend({
   url: 'https://dl.dropbox.com/s/2hk3xcbob8khjxa/cousine.json'
});
DEW.CommentsCollection = Backbone.Collection.extend({
   localStorage: new Backbone.LocalStorage("comments")
});DEW.ListCollection = Backbone.Collection.extend({
   url: 'https://dl.dropbox.com/s/7qrsjfp27u5tnbv/recetarioCollection.json',

   getByCategory: function(categoryId) {
       if (parseInt(categoryId) !== 0) {
           var filteredModels = this.where({
               category: parseInt(categoryId)
           });
           //Solo hago esto porque where devuelve un arreglo del modelo y se
           //necesita un array de objetos directos
           var result = [];
           for(var i=0;i < filteredModels.length; i++) {
               result.push(filteredModels[i].toJSON());
           }
           return result;
       } else {
           return this.toJSON();
       }
   },

   getItem: function(itemId) {
       return this.findWhere({
           id: parseInt(itemId)
       });
   }
}
        
        
        );DEW.LoginModel = Backbone.Model.extend({

    authenticate: function(email,password) {
        //Por ahora no vamos a llamar al servidor por lo tanto siempre retornamos true
        return true;
    }

});DEW.StoreManagerClass = function(){};
$.extend(DEW.StoreManagerClass.prototype, {

    items:{},

    get: function(key){
        return this.items[key] || null;
    },

    put: function(key, value){
        this.items[key] = value;
    },

    removeAll: function() {
        this.items = {};
    },

    remove: function(key) {
        try {
            delete this.items[key];
        } catch(e) {};
    }
});
DEW.StoreManager = new DEW.StoreManagerClass();DEW.ViewManager = (function(){
    this.items = [];

    this.addView = function(view){
        return this.items.push(view);
    };

    this.removeAll = function(){
        if(this.items && this.items.length > 0){
            $.each(this.items, function(idx, view){
                if(view && typeof view.close === 'function'){
                    view.close();
                }
            });
        }
    };

    this.remove = function(item){
        var index = $.inArray(item, this.items);
        this.items.splice(index,1);
    };

    return this;
})();Backbone.View.prototype.close = function() {
  this.stopListening();
  this.remove();
  this.trigger("close");
};DEW.BaseLayout = Backbone.View.extend({

    template : Handlebars.templates['base-layout'],



initialize: function() {
        //Aqui se puede poner configuracion inicial
    },
    render: function(){
        this.$el.html(this.template());
    }
    
});DEW.Body = Backbone.View.extend({

    template: Handlebars.templates['body'],


    initialize: function() {
        //Aqui se puede poner configuracion inicial
    },

    render: function() {
        this.$el.html(this.template());
    }
    

});DEW.Comments = Backbone.View.extend({

    template: Handlebars.templates['comments']
});DEW.DetailsLayout = Backbone.View.extend({

    template : Handlebars.templates['details-layout'],


 initialize: function() {
        //Aqui se puede poner configuracion inicial
    },
    render: function(){
        this.$el.html(this.template({}));
    }
});DEW.FinderLayout = Backbone.View.extend({

    template : Handlebars.templates['finder-layout'],


 initialize: function() {
        //Aqui se puede poner configuracion inicial
    },
    render: function(){
        this.$el.html(this.template({}));
    }
});DEW.Footer = Backbone.View.extend({

    template: Handlebars.templates['footer'],

    initialize: function() {
        //Aqui se puede poner configuracion inicial
    },

    render: function() {
        this.$el.html(this.template({
            //Algun parametro que le querramos configurar
        }));
    }
});DEW.Header = Backbone.View.extend({

    template: Handlebars.templates['header'],

    events: {
        "click .link" : "openLink",
        "click #btnLogin" : "openLogin",
       "click #btnTipoCocina" : "openFinder"
    },
    
    initialize: function() {
        //Aqui se puede poner configuracion inicial
    },

    render: function() {
        this.$el.html(this.template());
        enlaces: this.options.enlaces;
    },
     openLink: function(e) {
        e.preventDefault();
        //Obtengo cual es indice del elemento al que le hice click
        var idx = $(e.target).attr("data-id");
        //LLamo a handler que le pase como parametro
        this.options.enlaces[idx].handler();
    },
    
    openLogin: function(e){
      debugger;
     e.preventDefault();
    },
        openFinder: function(e){
       debugger;
      e.preventDefault();
    }
    
});DEW.Item = Backbone.View.extend({

    template: Handlebars.templates['item'],

    initialize: function() {},

    render: function() {
        this.$el.html(this.template({ item: this.model}));
    }
});DEW.List = Backbone.View.extend({

    template: Handlebars.templates['list'],

    categoryId: 0,
    
    initialize: function() {
        this.listenTo(this.model, 'reset',  this.render);
        
    },

    render: function() {
        this.$el.html(this.template({
            list: this.model.getByCategory(this.categoryId)
        }));
    }
});DEW.Login = Backbone.View.extend({

    template: Handlebars.templates['login'],

initialize: function() {
         
        //Aqui se puede poner configuracion inicial
    },
    
    render: function() {
       
        this.$el.html(this.template());
    }
    

});DEW.PopupWindow = Backbone.View.extend({
    template : Handlebars.templates['popup-window'],

    buttons: [],

    events: {
        "click .popup-window-footer .popup-window-footer-btn" : "mapFooterButtonHandler",
        "click .modal-header .close-icon" : "close"
    },

    initialize: function(){
        var me = this;

        me.ctClass = me.options.ctClass;
        me.title = me.options.title;
        me.panel = me.options.panel;
        me.buttons = me.options.buttons || [];
        me.buttons.push({
            id: 'cancel-btn',
            name : 'Cancelar',
            hidden: false,
            primary: false,
            handler: function() {
                this.close();
            }
        });
        me.needValidation = me.options.needValidation || false;

        me.listenTo(this.panel, 'ready', function() {
            this.$(".modal-body").append(me.panel.el);
        });
    },

    mapFooterButtonHandler: function(eventObject){
        var buttons = this.$('.popup-window-footer .popup-window-footer-btn'),
            button = eventObject.target,
            idx =  buttons.index(button),
            buttonCfg = this.buttons[idx];

        if(buttonCfg) {
            if (this.needValidation && buttonCfg.id !== "cancel-btn") {
                if (this.panel.validate()) {
                    buttonCfg.handler.call(this, button, buttons);
                }
            } else {
                buttonCfg.handler.call(this, button, buttons);
            }
        }

    },

    render:function(){
        var me = this;

        this.$el.html(this.template({
            ctClass : me.ctClass,
            title : this.title,
            buttons : this.buttons
        }));

        me.panel.render();

        this.$('.modal').modal({
            show: true,
            backdrop: 'static',
            keyboard: false
        });
    },

    close:function(){
        this.$('.modal').modal('hide');
        this.remove();
    }
});

DEW.Register = Backbone.View.extend({

    template: Handlebars.templates['register'],


    initialize: function() {
          
        //Aqui se puede poner configuracion inicial
    },

    render: function() {
       
        this.$el.html(this.template());
    }
    

});DEW.Sidebar = Backbone.View.extend({

    template: Handlebars.templates['sidebar'],

    currentCategoryId: 0,

    events: {
        "click .category_link" : "changeCategory"
    },

    initialize: function() {
        this.listenTo(this.model, 'reset',  this.render);
   
    },

    render: function() {
        var me = this;
        var categories = _.map(this.model.toJSON(),function(model) {
            model.active = me.currentCategoryId === model.id;
            return model;
        });
        this.$el.html(this.template({
            categories: categories
        }));
    },

    changeCategory: function(e) {
        e.preventDefault();
        this.currentCategoryId = parseInt($(e.target).attr("data-id"));
        this.render();
        this.trigger("changeCategory",this.currentCategoryId);
    }
});DEW.DetailsController = function() {};

$.extend(DEW.DetailsController.prototype, {
    render: function() {
        DEW.ViewManager.removeAll();
        this.displayLayout();
        this.displayHeader();
        this.displayBody();
       
    },

    displayLayout: function() {
        var detailsLayout = new DEW.DetailsLayout();
        detailsLayout.render();
        $(detailsLayout.el).appendTo("#content");
        DEW.ViewManager.addView(detailsLayout);
    },

    displayHeader: function() {
        var header = new DEW.Header();
        header.render();
        /* $(header.el).appendTo("#header"); */
        $("#header").html(header.el);
        
       var loginController = new DEW.LoginController();        
        $("#btnLogin").click(function(){
            DEW.ViewManager.remove(body);
            loginController.render();
             $(".page-content").html(loginController.el);
            DEW.ViewManager.addView(loginController);
        });
        
        var registerController = new DEW.RegisterController();        
        $("#btnResgistrate").click(function(){
            debugger;
            DEW.ViewManager.remove(body);
            registerController.render();
            $(".page-content").html(registerController.el);
            DEW.ViewManager.addView(registerController);
        });
        
        var finderController = new DEW.FinderController();
        $("#btnTipoCocina").click(function(){
            debugger;
            DEW.ViewManager.remove(body);
        finderController.render();       
        /* $(body.el).appendTo(".page-content"); */
        $(".page-content").html(finderController.el);      
        DEW.ViewManager.addView(finderController);
        });
        DEW.ViewManager.addView(header);
    },

    displayBody: function() {
        var listCollection = DEW.StoreManager.get('listCollection');
        if (listCollection === null) {
            listCollection = new DEW.ListCollection();
            listCollection.fetch({reset:true});
            listCollection.on('reset',function() {
                var itemModel = listCollection.getItem(DEW.itemID).toJSON();
                var itemView = new DEW.Item({
                    model: itemModel
                });
                itemView.render();
                $(itemView.el).appendTo(".page-content");
                DEW.ViewManager.addView(itemView);
            });
        } else {
            //Para mejorar la velocidad no recargo todo sino que reutilizo el codigo
            var itemModel = listCollection.getItem(DEW.itemID).toJSON();
            var itemView = DEW.Item({
                model: itemModel
            });
            itemView.render();
            $(itemView.el).appendTo(".page-content");
            DEW.ViewManager.addView(itemView);
        }
    }

   

});DEW.FinderController = function() {};

$.extend(DEW.FinderController.prototype, {
    render: function() {
        DEW.ViewManager.removeAll();
        this.displayLayout();
        this.displayHeader();
        this.displayBody();
       
    },

    displayLayout: function() {
        var finderLayout = new DEW.FinderLayout();
        finderLayout.render();
        $(finderLayout.el).appendTo("#content");
        DEW.ViewManager.addView(finderLayout);
    },

    displayHeader: function() {
        var header = new DEW.Header();
        header.render();
        /* $(header.el).appendTo("#header"); */
        $("#header").html(header.el);
        
        var loginController = new DEW.LoginController();        
        $("#btnLogin").click(function(){
            DEW.ViewManager.remove(body);
            loginController.render();
             $(".page-content").html(loginController.el);
            DEW.ViewManager.addView(loginController);
        });
        
        var registerController = new DEW.RegisterController();        
        $("#btnResgistrate").click(function(){
            debugger;
            DEW.ViewManager.remove(body);
            registerController.render();
            $(".page-content").html(registerController.el);
            DEW.ViewManager.addView(registerController);
        });
        
       var finderController = new DEW.FinderController();
        $("#btnTipoCocina").click(function(){
            debugger;
            DEW.ViewManager.remove(body);
        finderController.render();       
        /* $(body.el).appendTo(".page-content"); */
        $(".page-content").html(finderController.el);      
        DEW.ViewManager.addView(finderController);
        });
        DEW.ViewManager.addView(header);
    },
    displayBody: function() {

        //Cargando categorias
        var categoriesCollection = new DEW.CategoriesCollection();
        categoriesCollection.fetch({reset: true});

        var sidebar = new DEW.Sidebar({
            model: categoriesCollection
        });

        sidebar.on("changeCategory",function(categoryId) {
            listView.categoryId = categoryId;
            listView.render();
        });

        $(sidebar.el).appendTo(".sidebar");
        DEW.ViewManager.addView(sidebar);

        //Cargando lista de datos
        var listCollection = DEW.StoreManager.get('listCollection');
        if (listCollection === null) {
            listCollection = new DEW.ListCollection();
            listCollection.fetch({reset:true});
        }

        //Creando la vista y asociandole el modelo
        var listView = new DEW.List({
            model: listCollection
        });
        $(listView.el).appendTo(".page-content");
        DEW.ViewManager.addView(listView);
    }

   
});DEW.HomeController = function() {};

$.extend(DEW.HomeController.prototype, {
    render: function() {
        DEW.ViewManager.removeAll();
        this.displayLayout();
        this.displayHeader();
        this.displayBody();
        },

    displayLayout: function() {
        var baseLayout = new DEW.BaseLayout();
        baseLayout.render();
        $("#content").html(baseLayout.el);
        
        DEW.ViewManager.addView(baseLayout);
    },

    displayHeader: function() {
        var header = new DEW.Header();
        header.render();
        /* $(header.el).appendTo("#header"); */
        $("#header").html(header.el);
        
        
       var loginController = new DEW.LoginController();        
        $("#btnLogin").click(function(){
            DEW.ViewManager.remove(body);
            loginController.render();
            
            $(".page-content").html(loginController.el);
            DEW.ViewManager.addView(loginController);
        });
        
        
        var registerController = new DEW.RegisterController();        
        $("#btnResgistrate").click(function(){
            debugger;
            DEW.ViewManager.remove(body);
            registerController.render();
            $(".page-content").html(registerController.el);
            DEW.ViewManager.addView(registerController);
        });
        
        var finderController = new DEW.FinderController();
        $("#btnTipoCocina").click(function(){
            debugger;
            DEW.ViewManager.remove(body);
        finderController.render();       
        /* $(body.el).appendTo(".page-content"); */
      
         $("#content").html(finderController.el);
        DEW.ViewManager.addView(finderController);
        });
        DEW.ViewManager.addView(header);
    },
    

    displayBody: function() {
        
       
        
        var body = new DEW.Body();
        body.render();       
        /* $(body.el).appendTo(".page-content"); */
        $(".page-content").html(body.el);      
        DEW.ViewManager.addView(body);
        
    }


});DEW.LoginController = function() {};

$.extend(DEW.LoginController.prototype, {
    render: function() {
        DEW.ViewManager.removeAll();
        this.displayLayout();
        this.displayHeader();
        this.displayBody();
        },

    displayLayout: function() {
        var baseLayout = new DEW.BaseLayout();
        baseLayout.render();
        $("#content").html(baseLayout.el);
        
        DEW.ViewManager.addView(baseLayout);
    },

    displayHeader: function() {
        var header = new DEW.Header();
        header.render();
        /* $(header.el).appendTo("#header"); */
        $("#header").html(header.el);
        
        
        var loginController = new DEW.LoginController();        
        $("#btnLogin").click(function(){
            DEW.ViewManager.remove(body);
            loginController.render();
            
            $(".page-content").html(loginController.el);
            DEW.ViewManager.addView(loginController);
        });
        
        
         var registerController = new DEW.RegisterController();        
        $("#btnResgistrate").click(function(){
            debugger;
            DEW.ViewManager.remove(body);
            registerController.render();
            $(".page-content").html(registerController.el);
            DEW.ViewManager.addView(registerController);
        });
        
        var finderController = new DEW.FinderController();
        $("#btnTipoCocina").click(function(){
            debugger;
            DEW.ViewManager.remove(body);
        finderController.render();       
        /* $(body.el).appendTo(".page-content"); */
      
         $("#content").html(finderController.el);
        DEW.ViewManager.addView(finderController);
        });
        DEW.ViewManager.addView(header);
    },
    

    displayBody: function() {
        
       
        
        var login = new DEW.Login();
        login.render();       
        /* $(body.el).appendTo(".page-content"); */
        $(".page-content").html(login.el);      
        DEW.ViewManager.addView(login);
        
    }


});/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */


DEW.RegisterController = function() {};

$.extend(DEW.RegisterController.prototype, {
    render: function() {
        DEW.ViewManager.removeAll();
        this.displayLayout();
        this.displayHeader();
        this.displayBody();
        },

    displayLayout: function() {
        var baseLayout = new DEW.BaseLayout();
        baseLayout.render();
        $("#content").html(baseLayout.el);
        
        DEW.ViewManager.addView(baseLayout);
    },

    displayHeader: function() {
        var header = new DEW.Header();
        header.render();
        /* $(header.el).appendTo("#header"); */
        $("#header").html(header.el);
        
        
        var loginController = new DEW.LoginController();        
        $("#btnLogin").click(function(){
            DEW.ViewManager.remove(body);
            loginController.render();
            
            $(".page-content").html(loginController.el);
            DEW.ViewManager.addView(loginController);
        });
        
        
        var registerController = new DEW.RegisterController();        
        $("#btnResgistrate").click(function(){
            debugger;
            DEW.ViewManager.remove(body);
            registerController.render();
            $(".page-content").html(registerController.el);
            DEW.ViewManager.addView(registerController);
        });
        
        var finderController = new DEW.FinderController();
        $("#btnTipoCocina").click(function(){
            debugger;
            DEW.ViewManager.remove(body);
        finderController.render();       
        /* $(body.el).appendTo(".page-content"); */
      
         $("#content").html(finderController.el);
        DEW.ViewManager.addView(finderController);
        });
        DEW.ViewManager.addView(header);
    },
    

    displayBody: function() {
        
       
        
        var register = new DEW.Register();
        register.render();       
        /* $(body.el).appendTo(".page-content"); */
        $(".page-content").html(register.el);      
        DEW.ViewManager.addView(register);
        
    }


});/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */



DEW.appRouter = Backbone.Router.extend({
    routes: {
        "home" : "displayHome",
        "login" : "displayLogin",
        "register" : "displayRegister",
        "finder" : "displayFinder",
        "details/:id" : "displayDetails",
        "*actions" : "defaultRoute"
    },

    initialize: function(){
    
    

    },
     displayHome: function() {
        var homeController = new DEW.HomeController();
        homeController.render();
    },

    
     displayLogin: function() {
        var loginController = new DEW.LoginController();
        loginController.render();
    },
     displayRegister: function() {
        var registerController = new DEW.RegisterController();
        registerController.render();
    },
    displayFinder: function() {
        var finderController = new DEW.FinderController();
        finderController.render();
    },
    

    displayDetails: function(id) {
        DEW.itemID = id;
        var detailsController = new DEW.DetailsController();
        detailsController.render();
    },
    

    defaultRoute: function() {
        this.displayHome();
    }
});